<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户详细的页面</title>
    <script type="text/javascript">
        function todaochu() {
            document.forms[1].submit();
        }
    </script>
</head>
<body>
<#if pageInfo.total!=0>
<div>
    <span onclick="todaochu()" style="color: blue; cursor: pointer">【导出数据】</span>
    <span><a href="/logout">退出登录</a> </span>
    <h3 class="text-left text-success">
    欢迎您:<@shiro.principal property="username"/>
    您的账号id为:<@shiro.principal property="userid" />
    </h3>
</div>
<form action="/list">
    <input id="deptname" name="deptname" value="${deptname}">部门名称
    <input id="realname" name="realname" value="${realname}">用户真实姓名
    <button type="submit">查询</button>
</form>
<form id="form" action="/daochu">
<table>

    <thead>
    <tr>
        <td><input type="checkbox" width="30px" id="btn1"> </td>
        <td>序号</td>
       <th>用户姓名</th>
       <th>用户真实姓名</th>
       <th>部门名称</th>
       <th>职务名称</th>
        <td>个人头像</td>
        <th>操作</th>
    </tr>
    </thead>

    <tbody>
    <#list pageInfo.list as u >
        <tr>

        <td><input type="checkbox" name="userid" value="${u.userid}" id="dsfs"</td>
            <td>${u.userid}</td>
        <td>${u.username}</td>
        <td>${u.realname}</td>
        <td>${u.deptname}</td>
        <td>${u.majorname}</td>
        <td>
            <img style="width: 30px;height: 30px;" src="${u.headPic}" />
        </td>
        <td><a href="/user/detail?realname=${u.realname}">用户资料详情</a> </td>
        <td><a href="/update?realname=${u.realname}">编辑用户</a> </td>
        <td><a href="/updatePs?realname=${u.realname}">修改密码</a> </td>
        <td><a href="/getAllDepts">创建用户</a></td>
       <td><a href="del?realname=${u.realname}">删除用户</a> </td>

    </tr>

    </#list >

    </tbody>
</table>
</form>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <ul class="pagination">
                <#if pageInfo.hasPreviousPage >
                <#--&stu_no=${stu_no}&stu_name=${stu_name}-->
                    <li>
                        <a href="javascript:;" onclick="location.href='/list?index=1&size=${pageInfo.size}&deptname=${deptname}&realname=${realname}'">首页</a>
                    </li>
                    <li>
                        <a href="javascript:;" onclick="location.href='/list?index=${pageInfo.prePage}&size=${pageInfo.size}&deptname=${deptname}&realname=${realname}'">上一页</a>
                    </li>
                </#if>
                <#if pageInfo.pageNum lt pageInfo.pages >
                    <li>
                        <a href="javascript:;" onclick="location.href='/list?index=${pageInfo.nextPage}&deptname=${deptname}&realname=${realname}'">下一页</a>
                    </li>
                    <li>
                        <a href="javascript:;" onclick="location.href='/list?index=${pageInfo.pages}&deptname=${deptname}&realname=${realname}'">尾页</a>
                    </li>
                    共${pageInfo.total}条  ${pageInfo.pageNum}/${pageInfo.pages}
                </#if>
        </div>
        </#if>
<#if pageInfo.total==0>
    <form action="/list">
        <input id="deptname" name="deptname" value="${deptname}">部门名称
        <input id="realname" name="realname" value="${realname}">用户真实姓名
        <button type="submit">查询</button>
    </form>
    <h1>抱歉,暂无本人数据！</h1>
</#if>
        <script src="/js/jquery.js"></script>
        <script>
            //多选框全选
            $(function(){
                $("#btn1").click(function(){
                    //1.得到点击按钮的状态  checked 属于js对象中的属性
                    //jquery->js
                    var state=$(this)[0].checked;
                    // alert(state);
                    //2.设置全选，选中的state位true，未选中位false
                    var cks=document.getElementsByName("userid");
                    for(var i=0;i<cks.length;i++){
                        //将子按钮设置和父按钮的状态一样
                        cks[i].checked=state;
                    }
                });
            })

        </script>

</body>
</html>